package ch.fusun.baron.property;

import ch.fusun.baron.core.injection.Inject;
import ch.fusun.baron.data.DataUpdate;
import ch.fusun.baron.property.api.PropertyService;

/**
 * 
 */
public class SetOwnerShipDataUpdate implements DataUpdate {

	private Object owner;
	private Object owned;
	@Inject
	private transient PropertyService propertyService;

	/**
	 * Kryo
	 */
	public SetOwnerShipDataUpdate() {
	}

	/**
	 * @param owner
	 * @param owned
	 */
	public SetOwnerShipDataUpdate(Object owner, Object owned) {
		this.owner = owner;
		this.owned = owned;
	}

	@Override
	public void update() {
		propertyService.setOwnership(owner, owned);
	}

}
